package com.easy.iot;

import org.eclipse.paho.client.mqttv3.*;

/**
 * @Packge com.easy.iot
 * @Autor naibin.lin
 * @Description
 * @Version 1.0
 * @Date 2022-08-08 16:54
 */
public class Mqtt {


    public static void main(String[] args) throws Exception {

        String serverURI = "tcp://10.10.20.50:1883";
        // String serverURI = "tcp://127.0.0.1:1884";
        MqttClient client = new MqttClient(serverURI, "client-id");
        client.connect();

        // pangu/#
        client.subscribe("pangu/image/cm101", new MessageListener());


    }
}
